<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/jsp/web/commons/global.jsp"%>

<div class="report-wrapper">
	<div class="title">
		<span> 我要举报的是"<span class="be-reported-name">@${comment.user.nickname }</span>"<span>发表的评论:</span>
		</span>
	</div>
	<div class="vertical-spacing-10"></div>
	<div class="be-reported-content">
		<div class="user-img-div">
			<img src="${comment.user.portraitUrl }" />
		</div>
		<div class="content">
			<span class="be-reported-name">@${comment.user.nickname }:</span> <span
				class="text">${comment.content } </span>
		</div>
		<div class="clear-both"></div>
	</div>
	<div class="report-type-wrapper">
		<div class="report-type-contetn">
			<div class="row">
				<div class="col-md-6">
					<div class="radio">
						<label> <input type="radio" name="reportType"
							id="junkMarketing" value="1" checked> 垃圾营销
						</label>
					</div>
				</div>
				<div class="col-md-6">
					<div class="radio">
						<label> <input type="radio" name="reportType" id="obscene"
							value="2"> 淫秽色情
						</label>
					</div>
				</div>
			</div>
			<div class="row">
				<div class="col-md-6">
					<div class="radio">
						<label> <input type="radio" name="reportType"
							id="harmfulInformation" value="3"> 有害信息
						</label>
					</div>
				</div>
				<div class="col-md-6">
					<div class="radio">
						<label> <input type="radio" name="reportType"
							id="personalAttackMe" value="4"> 人身攻击我
						</label>
					</div>
				</div>
			</div>
			<div class="row">
				<div class="col-md-6">
					<div class="radio">
						<label> <input type="radio" name="reportType"
							id="illegalInformation" value="5"> 违法信息
						</label>
					</div>
				</div>
			</div>
			<div class="vertical-spacing-10"></div>
			<div class="spit-hr-1"></div>
			<div class="vertical-spacing-20"></div>
			<a class="btn btn-default btn-sm report-btn">提交</a>

		</div>
	</div>
</div>

<script type="text/javascript">
	$(function() {
		$(
				'.report-model-wrapper .report-wrapper .report-type-wrapper .report-btn')
				.click(
						function() {
							var options = {
								type : '',
								msg : '',
								hasClose : true,
								time : 3000
							};

							var _this = $(this);
							var type = _this.parent().find(
									".row :input[name='reportType']:checked")
									.val();
							$
									.ajax({
										async : false,
										type : "POST",
										data : {
											itemType : 4,
											itemId : ${comment.id},
											type : type
										},
										url : baseUrl + "/expose/add",
										success : function(responseData) {
											if (responseData.responseCode == '000') {
												options.type = SELF_ALERT_TYPES.success;
												options.msg = '举报提交成功';
												selfAlert(options);
												closeExprose();
											} else {
												options.type = SELF_ALERT_TYPES.danger;
												options.msg = responseData.responseMessage;
												selfAlert(options);
											}

										},
										error : function(XMLHttpRequest,
												textStatus, errorThrown) {
											var msg = XMLHttpRequest.statusText;
											var _options = {
												type : SELF_ALERT_TYPES.danger,
												msg : msg,
												hasClose : true,
												time : 3000
											};
											selfAlert(_options);
										}
									});
						});
	});
</script>